package com.william.jdbcplus.test.entity;

import com.william.jdbcplus.common.annotation.*;
import com.william.jdbcplus.common.entity.Entity;
import com.william.jdbcplus.common.enums.IdType;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@Table("db_user_dept")
@ApiModel("用户部门关联表")
@TableUks({
        @TableUk(fields = {"userId", "deptId"})
})
public class DbUserDept implements Entity {
    @TableId(type = IdType.GUID)
    private String id;

    @TableColumn(remarks = "用户id", nullable = false)
    @TableFk(pkEntity = DbUser.class, pkField = "id")
    private String userId;

    @TableColumn(remarks = "部门id", nullable = false)
    @TableFk(pkEntity = DbDept.class, pkField = "id")
    private String deptId;
}
